package com.nsgf.library.data.bean;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;

import com.nsgf.library.BR;

import java.util.List;

/**
 * 通知公告数据模型
 */
public class AnnouncementBean {

    private List<RecordBean> records;
    private int total;
    private int size;
    private int current;
    private int pages;

    public List<RecordBean> getRecords() {
        return records;
    }

    public void setRecords(List<RecordBean> records) {
        this.records = records;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getCurrent() {
        return current;
    }

    public void setCurrent(int current) {
        this.current = current;
    }

    public int getPages() {
        return pages;
    }

    public void setPages(int pages) {
        this.pages = pages;
    }

    /**
     * 通知公告记录项
     */
    public static class RecordBean extends BaseObservable {
        private int id;
        private String announcementTopic;
        private String description;
        private String image;
        private List<String> imageList;
        private String video;
        private List<String> videoList;
        private String file;
        private List<String> fileList;
        private Integer createBy;
        private String createTime;
        private Integer updateBy;
        private String updateTime;
        private int isDelete;
        private int isRead;

        @Bindable
        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
            notifyPropertyChanged(BR.id);
        }

        @Bindable
        public String getAnnouncementTopic() {
            return announcementTopic;
        }

        public void setAnnouncementTopic(String announcementTopic) {
            this.announcementTopic = announcementTopic;
            notifyPropertyChanged(BR.announcementTopic);
        }

        @Bindable
        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
            notifyPropertyChanged(BR.description);
        }

        @Bindable
        public String getImage() {
            return image;
        }

        public void setImage(String image) {
            this.image = image;
            notifyPropertyChanged(BR.image);
        }

        @Bindable
        public List<String> getImageList() {
            return imageList;
        }

        public void setImageList(List<String> imageList) {
            this.imageList = imageList;
            notifyPropertyChanged(BR.imageList);
        }

        @Bindable
        public String getVideo() {
            return video;
        }

        public void setVideo(String video) {
            this.video = video;
            notifyPropertyChanged(BR.video);
        }

        @Bindable
        public List<String> getVideoList() {
            return videoList;
        }

        public void setVideoList(List<String> videoList) {
            this.videoList = videoList;
            notifyPropertyChanged(BR.videoList);
        }

        @Bindable
        public String getFile() {
            return file;
        }

        public void setFile(String file) {
            this.file = file;
            notifyPropertyChanged(BR.file);
        }

        @Bindable
        public List<String> getFileList() {
            return fileList;
        }

        public void setFileList(List<String> fileList) {
            this.fileList = fileList;
            notifyPropertyChanged(BR.fileList);
        }

        @Bindable
        public Integer getCreateBy() {
            return createBy;
        }

        public void setCreateBy(Integer createBy) {
            this.createBy = createBy;
            notifyPropertyChanged(BR.createBy);
        }

        @Bindable
        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
            notifyPropertyChanged(BR.createTime);
        }

        @Bindable
        public Integer getUpdateBy() {
            return updateBy;
        }

        public void setUpdateBy(Integer updateBy) {
            this.updateBy = updateBy;
            notifyPropertyChanged(BR.updateBy);
        }

        @Bindable
        public String getUpdateTime() {
            return updateTime;
        }

        public void setUpdateTime(String updateTime) {
            this.updateTime = updateTime;
            notifyPropertyChanged(BR.updateTime);
        }

        @Bindable
        public int getIsDelete() {
            return isDelete;
        }

        public void setIsDelete(int isDelete) {
            this.isDelete = isDelete;
            notifyPropertyChanged(BR.isDelete);
        }

        @Bindable
        public int getIsRead() {
            return isRead;
        }

        public void setIsRead(int isRead) {
            this.isRead = isRead;
            notifyPropertyChanged(BR.isRead);
        }

        /**
         * 获取未读标识的可见性（0=未读显示，1=已读隐藏）
         */
        @Bindable
        public int getUnreadVisibility() {
            return isRead == 0 ? android.view.View.VISIBLE : android.view.View.GONE;
        }
    }
}

